package com.xgx.faceloginback.controller;

import com.jfinal.captcha.CaptchaRender;
import com.jfinal.core.ActionKey;
import io.jboot.Jboot;
import io.jboot.web.controller.JbootController;
import io.jboot.web.controller.annotation.RequestMapping;

import cn.hutool.captcha.*;
import io.jboot.web.cors.EnableCORS;

import java.io.IOException;

@RequestMapping("/auth")
@EnableCORS
public class AuthController extends JbootController {

    public void index() throws IOException {
        LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(200, 100);
        lineCaptcha.write(getResponse().getOutputStream());
        System.out.println(lineCaptcha.getCode());
        renderCaptcha();
    }
}
